//
//  UILabel+GSCommonLabel.m
//  GSLoginDemo
//
//  Created by guoshikeji_a on 2018/7/27.
//  Copyright © 2018年 guoshikeji. All rights reserved.
//

#import "UILabel+GSCommonLabel.h"

#import "GSCommonLoginPrefixProfile.h"

@implementation UILabel (GSCommonLabel)

+ (UILabel *)commonLargeTitleLabel {
    UILabel *label = [UILabel new];
    label.textColor = GSLOGINRGBRGBHEX(0x333333);
    label.numberOfLines = 0;
    label.lineBreakMode = NSLineBreakByCharWrapping;
    label.font = [UIFont systemFontOfSize:35 weight:UIFontWeightLight];
    return label;
}

+ (UILabel *)subTitleLabel {
    UILabel *label = [UILabel new];
    label.textColor = GSLOGINRGBRGBHEX(0x666666);
    label.numberOfLines = 0;
    label.lineBreakMode = NSLineBreakByCharWrapping;
    label.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
    return label;
}


+ (UILabel *)safeAlertLabel {
    UILabel *label = [UILabel new];
    label.textAlignment = NSTextAlignmentCenter;
    label.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
    label.textColor = GSLOGINRGBRGBHEX(0x6C6C6C);
    label.numberOfLines = 0;
    //设置内容
    //图片
    NSTextAttachment *textAttachment = [NSTextAttachment new];
    textAttachment.image = [UIImage imageNamed:@"gslogin_safe_log"];
    NSAttributedString *imageAttri = [NSAttributedString attributedStringWithAttachment:textAttachment];

    NSMutableAttributedString *attringText = [[NSMutableAttributedString alloc] initWithAttributedString:imageAttri];
    //文字
    NSString *appName = [GSCommonLoginAppInfomation appDisplayName];
    NSString *string = [NSString stringWithFormat:@"\r\n%@",GSLoginLocalizedFormatString(@"%@ LoginSafety",appName)];
    NSAttributedString *attri = [[NSAttributedString alloc] initWithString:string];

    [attringText appendAttributedString:attri];
    //
    label.attributedText = attringText;
    //
    return label;
}

@end
